package edu.ccut.saturn.studio.naviagtor;

import org.eclipse.core.resources.IFile;

public class SaturnContentProvider extends
		org.eclipse.jdt.internal.ui.navigator.JavaNavigatorContentProvider {

	public SaturnContentProvider() {
		super(false);
	}

	public boolean hasChildren(Object element) {
		boolean hasChildren = super.hasChildren(element);

		if (hasChildren) {// 如果只有.saturn文件认为没有子节点
			Object[] children = super.getChildren(element);
			if (children.length == 1) {
				if (children[0] instanceof IFile) {
					if (((IFile) children[0]).getName().endsWith(".saturn")) {
						hasChildren = false;
					}
				}
			}
		}

		return hasChildren;
	}
}
